Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kolla-Ansible/Kayobe version enforcement #1551

Open
wants to merge 20 commits into
base: stackhpc/2024.1
Choose a base branch
from

Conversation

assumptionsandg
Copy link
Contributor

No description provided.

@assumptionsandg assumptionsandg requested a review from a team as a code owner March 3, 2025 13:52
@product-auto-label product-auto-label bot added size: m ansible Ansible playbooks labels Mar 3, 2025
@assumptionsandg
Copy link
Contributor Author

Skipping the linter as I don't think it's possible to use git describe as part of the Ansible git module.

@assumptionsandg
Copy link
Contributor Author

assumptionsandg commented Mar 5, 2025

Requires pip 24.0 or newer. (precheck added in 88dba74)

fail_msg: |
Pip must be 24.0 or newer to run this check. Upgrade pip by running
pip install -U pip and reinstall Kayobe by running:
pip install --force-reinstall -r {{ requirements_path }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the order here must be observed as Kayobe installed on an older verison of pip will still show the incorrect version output in pip freeze, breaking the check.

@mnasiadka
Copy link
Member

Out of my curiosity - why are we doing that here jnstead in the Kayobe python CLI?

@assumptionsandg
Copy link
Contributor Author

assumptionsandg commented Mar 6, 2025

Out of my curiosity - why are we doing that here jnstead in the Kayobe python CLI?

This is more of a workaround for Kayobe/Kolla CLI version returning a different value from our downstream tagging, which don't follow pbr versioning.

See upstream bug https://bugs.launchpad.net/kayobe/+bug/2101051

@assumptionsandg assumptionsandg changed the title Check Kayobe version playbook Kolla-Ansible/Kayobe version enforcement Mar 6, 2025
executable: /usr/bin/bash
register: kayobe_git_commit

- name: Clone Kayobe
Copy link
Contributor

@jovial jovial Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if instead of doing all this manually, could you use:

pip install . --dry-run --report /tmp/test.json

Which i think will tell you the new commit of kayobe it would install.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this approach will work here, as we're cloning Kayobe to get the commit that matches up with the currently installed tag from the git SHA outputted in the venv, rather than the newest commit from Kayobe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So just to clarify, I was suggesting doing a dry run pip install of kayobe-config. That would work with any repo specified in requirements.txt, whereas this solution has some custom parsing of that and is hardcoded to:

       - name: Clone Kayobe
          ansible.builtin.git:
            repo: https://github.com/stackhpc/kayobe.git
            dest: /tmp/kayobe-git
            version: stackhpc/{{ openstack_release }}

But was just a thought and can accept it might not do what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible Ansible playbooks size: m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants